package com.foo.designpattern.factory.factorymethodpattern;

import junit.framework.TestCase;

/**
 * com.foo.designpattern.factory.factorymethodpattern
 * Created with IntelliJ IDEA.
 * User: wangyuxi
 * DateTime: 2016/4/1721:21
 *
 * @desc
 */
public class FactoryMethodTestCase extends TestCase {

    public void testBmwFactory() {
        Icarfactory factory = new BmwFactory();
        Icar bwm = factory.createCar();
        bwm.docar();  //我是宝马，别摸我
    }

    public void testBuickFactory() {
        BuickFactory factory = new BuickFactory();
        Icar buick = factory.createCar();
        buick.docar(); //我是别克，很酷
    }
}
